<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<a id="a" href="#">123</a>
</body>
<script>
    const a = document.getElementById("a");
    a.onclick = function() {
        console.log(11111)
        window.location.href = "https://www.baidu.com/"
    }

</script>
</html>
